/**
 * @Author: lifuzhao
 * @Date: 2019-07-11
 * @Project: driver
 */
import provinces from 'china-division/dist/provinces.json';
import cities from 'china-division/dist/cities.json';

cities.forEach((city) => {
  const matchProvince = provinces.filter(province => province.code === city.provinceCode)[0];
  if (matchProvince) {
    matchProvince.children = matchProvince.children || [];
    matchProvince.children.push({
      label: city.name,
      value: city.name
    });
  }
});
export const options = provinces.map(province => ({
  label: province.name,
  value: province.name,
  children: province.children,
}));


export const pageSize = 10
export const dateFormat = 'YYYY-MM-DD'
export const dateValueFormat = 'yyyy-MM-dd'
export const timeFormat = 'yyyy-MM-dd HH:mm:SS'
export const navConfig = [
  {
    index: '/order'
    , title: '订单记录'
    , icon: 'el-icon-s-order'
  }
  , {
    index: '/driver'
    , title: '司机管理'
    , icon: 'el-icon-s-flag'
    , auth: [1, 3]
    , children: [
      {
        index: '/driver/onlineStats'
        , title: '在线统计'
      }
      , {
        index: '/driver/location'
        , title: '地理位置'
      }
      , {
        index: '/driver/accountManage'
        , title: '账号管理'
      }
    ]
  }
  , {
    index: '/hotel'
    , title: '酒店管理'
    , icon: 'el-icon-office-building'
    , auth: [1]
    , children: [
      {
        index: '/hotel/list'
        , title: '酒店列表'
      }
      , {
        index: '/hotel/order'
        , title: '酒店订单'
      }
    ]
  }
  , {
    index: '/franchisee'
    , title: '代理商管理'
    , icon: 'el-icon-s-opportunity'
    , auth: [1, 3]
  }
  , {
    index: '/userManage'
    , title: '用户管理'
    , icon: 'el-icon-s-custom'
    , auth: [1, 3]
  }
  , {
    index: '/coupon'
    , title: '卡劵管理'
    , icon: 'el-icon-s-ticket'
    , auth: [1, 3]
    , children: [
      {
        index: '/coupon/setting'
        , title: '卡劵设置'
      }
      // , {
      //   index: '/coupon/distribution'
      //   , title: '派发记录'
      // }
    ]
  }
  , {
    index: '/charge'
    , title: "服务费设置"
    , icon: 'el-icon-s-finance'
    , auth: [1, 3]
  }
  // , {
  //   index: '/permission/manage'
  //   , title: '权限管理'
  //   , icon: 'el-icon-s-tools'
  // }
  , {
    index: '/announcement/manage'
    , title: '公告管理'
    , icon: 'el-icon-message-solid'
    , auth: [1, 3]
  },
  {
    index: '/feedback'
    , title: '用户反馈'
    , icon: 'el-icon-s-help'
    , auth: [1, 3]
  },
  {
    index: '/shortMessage',
    title: '短信管理',
    icon: 'el-icon-s-comment',
    auth: [1, 3],
    children: [{
      title: '短信记录',
      index: '/shortMessage'
    }, {
      title: '充值记录',
      index: '/shortMessage/rechargeRecord'
    }, {
      title: '充值模板',
      index: '/shortMessage/rechargeTemplate',
      auth: [3]
    }]
  },
]

export const orderStatus = [
  {
    label: '全部'
    , value: 6
  }
  , {
    label: '未接单'
    , value: 1
  }
  , {
    label: '已接单'
    , value: 2
  }
  , {
    label: '完成'
    , value: 4
  }
  , {
    label: '已经撤销'
    , value: 5
  }
]
export const orderSource = [
  {
    label: '不限'
    , value: 5
  }
  , {
    label: '乘客订单'
    , value: 1
  }
  , {
    label: '平台派单'
    , value: 2
  }
  , {
    label: '司机自建'
    , value: 3
  }
]
export const driverOnlineStatus = [
  {
    label: '不限'
    , value: 3
  }
  , {
    label: '上线'
    , value: 1
  }
  , {
    label: '下线'
    , value: 2
  }
]
export const driverActivateStatus = [
  {
    label: '不限'
    , value: 3
  }
  , {
    label: '正常'
    , value: 1
  }
  , {
    label: '停用'
    , value: 2
  }
]
export const announcementType = [
  {
    label: '不限'
    , value: ''
  }
]
export const announcementArea = [
  {
    label: '不限'
    , value: ''
  }
]
export const couponScene = [
  {
    label: '新用户减免'
    , value: 1
  }
  , {
    label: '首次关注公众号'
    , value: 2
  }, {
    label: '日常补助优惠券',
    value: 3
  }
]

export const grades = {
  grade_1: '管理员'
  , grade_2: '保险人员'
  , grade_3: '系统管理员'
}
